package com.itheima.stringdemo;

public class StringDemo8 {
    public static void main(String[] args) {
        String result = reverser("abc");
        System.out.println(result);
    }

    public static String reverser(String str) {
        String result = "";
        // Shift+Fn+F6（选中一个变量，批量修改）
        for (int i = str.length() - 1; i >= 0; i--) {
            result += str.charAt(i);
        }
        return result;
    }
}
